﻿//-------------------------------------
// WBFSSync - WBFSSync.exe
//
// Copyright 2009 Caian (ÔmΣga Frøst) <frost.omega@hotmail.com> :
//
// WBFSSync is Licensed under the terms of the Microsoft Reciprocal License (Ms-RL)
//
// Skin.cs:
//
// Carrega os recursos gráficos utilizados pelo aplicativo
//
//-------------------------------------

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.IO;

namespace WBFSSync
{
    static class Skin
    {
        public static string SkinFolder = @"Skin\";
        
        public const string DefaultSkin = "AeroSeven";

        public static String SelectedSkin = DefaultSkin;
        public static String FailedSkinFile = "";

        public static bool SkinReady = false;

        public static string[] AvaliableSkins = new string[0];

        //------------------------ Sons

        public static String explorer_double_click_sound = "";

        //------------------------ Menu

        public static Image menu_background = null;
        
        public static Image menu_separator = null;

        public static Image menu_button_arrow = null;
        public static Image menu_button_l_o = null;
        public static Image menu_button_l_c = null;
        public static Image menu_button_m_o = null;
        public static Image menu_button_m_c = null;
        public static Image menu_button_r_normal_o = null;
        public static Image menu_button_r_normal_c = null;
        public static Image menu_button_r_dropdown_o = null;
        public static Image menu_button_r_dropdown_c = null;
        public static Image menu_button_warning_l_o = null;
        public static Image menu_button_warning_m_o = null;
        public static Image menu_button_warning_r_o = null;

        //------------------------ Layout de Controles

        //---------- Pathbox

        public static Image pathbox_l = null;
        public static Image pathbox_m = null;
        public static Image pathbox_m_s = null;
        public static Image pathbox_refresh = null;
        public static Image pathbox_refresh_s = null;
        public static Image pathbox_refresh_o = null;
        public static Image pathbox_refresh_c = null;
        public static Image pathbox_selection_l_o = null;
        public static Image pathbox_selection_l_c = null;
        public static Image pathbox_selection_m_o = null;
        public static Image pathbox_selection_m_c = null;
        public static Image pathbox_selection_r_o = null;
        public static Image pathbox_selection_r_c = null;
        public static Image pathbox_separator_arrow = null;

        //---------- Explorer

        public static Image explorer_detail_selection_l_o = null;
        public static Image explorer_detail_selection_l_c = null;
        public static Image explorer_detail_selection_l_oc = null;
        public static Image explorer_detail_selection_m_o = null;
        public static Image explorer_detail_selection_m_c = null;
        public static Image explorer_detail_selection_m_oc = null;
        public static Image explorer_detail_selection_r_o = null;
        public static Image explorer_detail_selection_r_c = null;
        public static Image explorer_detail_selection_r_oc = null;

        public static Image explorer_tile_selection_t_o = null;
        public static Image explorer_tile_selection_t_c = null;
        public static Image explorer_tile_selection_t_oc = null;
        public static Image explorer_tile_selection_m_o = null;
        public static Image explorer_tile_selection_m_c = null;
        public static Image explorer_tile_selection_m_oc = null;
        public static Image explorer_tile_selection_b_o = null;
        public static Image explorer_tile_selection_b_c = null;
        public static Image explorer_tile_selection_b_oc = null;

        public static Image explorer_header_arrow_up = null;
        public static Image explorer_header_arrow_down = null;

        public static Image explorer_header_l = null;
        public static Image explorer_header_l_o = null;
        public static Image explorer_header_l_c = null;
        public static Image explorer_header_m = null;
        public static Image explorer_header_m_o = null;
        public static Image explorer_header_m_c = null;
        public static Image explorer_header_r = null;
        public static Image explorer_header_r_o = null;
        public static Image explorer_header_r_c = null;

        //---------- Quick Links

        public static Image quicklink_l_o = null;
        public static Image quicklink_l_c = null;
        public static Image quicklink_l_oc = null;
        public static Image quicklink_m_o = null;
        public static Image quicklink_m_c = null;
        public static Image quicklink_m_oc = null;
        public static Image quicklink_r_o = null;
        public static Image quicklink_r_c = null;
        public static Image quicklink_r_oc = null;

        //---------- Guia Horizontal

        public static Image tab_horizontal_l = null;
        public static Image tab_horizontal_l_o = null;
        public static Image tab_horizontal_l_c = null;
        public static Image tab_horizontal_m = null;
        public static Image tab_horizontal_m_o = null;
        public static Image tab_horizontal_m_c = null;
        public static Image tab_horizontal_r = null;
        public static Image tab_horizontal_r_o = null;
        public static Image tab_horizontal_r_c = null;

        //------------------------ Barras de progresso

        public static Image progressbar_blue = null;
        public static Image progressbar_green = null;
        public static Image progressbar_red = null;
        public static Image progressbar_gray = null;

        public static Image progresscontainer_l = null;
        public static Image progresscontainer_m = null;
        public static Image progresscontainer_r = null;

        //------------------------ Ícones
        
        //---------- analisador de FS

        public static Image drivemapblock_blue = null;
        public static Image drivemapblock_red = null;
        public static Image drivemapblock_green = null;
        public static Image drivemapblock_yellow = null;
        public static Image drivemapblock_gray = null;

        //---------- quick links & explorer

        public static Image icon_16x16_desktop = null;
        public static Image icon_16x16_documents = null;
        public static Image icon_16x16_folder = null;
        public static Image icon_16x16_file = null;
        public static Image icon_16x16_zip = null;
        public static Image icon_16x16_iso = null;
        public static Image icon_16x16_disc = null;
        public static Image icon_16x16_covers = null;
        public static Image icon_16x16_favorites = null;
        public static Image icon_16x16_library = null;
        public static Image icon_16x16_computer = null;

        public static Image icon_16x16_harddrive = null;
        public static Image icon_16x16_usbdrive = null;
        public static Image icon_16x16_windrive = null;
        public static Image icon_16x16_cddrive = null;
        public static Image icon_16x16_cddrive_full = null;
        public static Image icon_16x16_wbfsdrive = null;
        public static Image icon_16x16_floppydrive = null;

        public static Image icon_48x48_harddrive = null;
        public static Image icon_48x48_usbdrive = null;
        public static Image icon_48x48_windrive = null;
        public static Image icon_48x48_cddrive = null;
        public static Image icon_48x48_cddrive_full = null;
        public static Image icon_48x48_wbfsdrive = null;
        public static Image icon_48x48_floppydrive = null;
        public static Image icon_48x48_bigfloppydrive = null;

        public static Image icon_48x48_wiidisc = null;
        public static Image icon_48x48_wiidisc_jap = null;
        public static Image icon_48x48_wiidisc_usa = null;
        public static Image icon_48x48_wiidisc_eur = null;
        public static Image icon_48x48_wiidisc_unk = null;

        public static Image icon_48x48_folder = null;
        public static Image icon_48x48_file = null;
        public static Image icon_48x48_zip = null;
        public static Image icon_48x48_iso = null;

        public static Image icon_72x72_folder = null;
        public static Image icon_72x72_file = null;
        public static Image icon_72x72_zip = null;
        public static Image icon_72x72_iso = null;

        //---------- operações

        public static Image icon_11x11_export_covers = null;
        public static Image icon_11x11_export_covers_o = null;

        public static Image icon_11x11_add = null;
        public static Image icon_11x11_add_o = null;

        public static Image icon_11x11_remove = null;
        public static Image icon_11x11_remove_o = null;

        public static Image icon_11x11_ripdvd = null;
        public static Image icon_11x11_ripdvd_o = null;

        public static Image icon_16x16_cut = null;
        public static Image icon_16x16_copy = null;
        public static Image icon_16x16_paste = null;
        public static Image icon_16x16_delete = null;

        //---------- log

        public static Image icon_16x16_log_error = null;
        public static Image icon_16x16_log_warning = null;
        public static Image icon_16x16_log_message = null;

        //---------- guias

        public static Image icon_16x16_log = null;
        public static Image icon_16x16_clipboard = null;
        public static Image icon_16x16_operations = null;

        //---------- menu

        public static Image icon_16x16_config = null;
        public static Image icon_16x16_donate = null;
        public static Image icon_16x16_help = null;

        //---------- modo de exibição

        public static Image icon_16x16_view_cover = null;
        public static Image icon_16x16_view_tile = null;
        public static Image icon_16x16_view_details = null;
        public static Image icon_16x16_view_list = null;

        //---------- capas

        public static Image cover_nocover = null;
        public static Image cover_nocover_big = null;

        public static Image cover_shadow = null;
        public static Image cover_shadow_big = null;

        //------------------------ Fontes

        public static Font CaptionFont = null;
        public static Font DefaultFont = null;
        public static Font DialogFont = null;
        public static Font IconTitleFont = null;
        public static Font MenuFont = null;
        public static Font MessageBoxFont = null;
        public static Font SmallCaptionFont = null;
        public static Font StatusFont = null;

        //------------------------ Rotinas

        public static int EnumerateSkins()
        {
            int i = 0;
            try
            {
                AvaliableSkins = Directory.GetDirectories(SkinFolder);
                i = AvaliableSkins.Length;

                for (int j = 0; j < i; j++) AvaliableSkins[j] = Path.GetFileName(AvaliableSkins[j]);
            }
            catch (Exception e)
            {
                Log.LogException(e);
                AvaliableSkins = new string[0];
            }

            return i;
        }

        public static bool LoadSkin(String skin)
        {
            SkinReady = false;

            try
            {
                //---------- Sons

                explorer_double_click_sound = SkinFolder + skin + @"\explorer_double_click.wav";

                //---------- Menu

                menu_background = Image.FromFile(SkinFolder + skin + @"\menu_background.png");

                menu_separator = Image.FromFile(SkinFolder + skin + @"\menu_separator.png");

                menu_button_arrow = Image.FromFile(SkinFolder + skin + @"\menu_button_arrow.png");
                menu_button_l_o = Image.FromFile(SkinFolder + skin + @"\menu_button_l_o.png");
                menu_button_l_c = Image.FromFile(SkinFolder + skin + @"\menu_button_l_c.png");
                menu_button_m_o = Image.FromFile(SkinFolder + skin + @"\menu_button_m_o.png");
                menu_button_m_c = Image.FromFile(SkinFolder + skin + @"\menu_button_m_c.png");
                menu_button_r_normal_o = Image.FromFile(SkinFolder + skin + @"\menu_button_r_normal_o.png");
                menu_button_r_normal_c = Image.FromFile(SkinFolder + skin + @"\menu_button_r_normal_c.png");
                menu_button_r_dropdown_o = Image.FromFile(SkinFolder + skin + @"\menu_button_r_dropdown_o.png");
                menu_button_r_dropdown_c = Image.FromFile(SkinFolder + skin + @"\menu_button_r_dropdown_c.png");
                menu_button_warning_l_o = Image.FromFile(SkinFolder + skin + @"\menu_button_warning_l_o.png");
                menu_button_warning_m_o = Image.FromFile(SkinFolder + skin + @"\menu_button_warning_m_o.png");
                menu_button_warning_r_o = Image.FromFile(SkinFolder + skin + @"\menu_button_warning_r_o.png");

                //---------- Pathbox

                pathbox_l = Image.FromFile(SkinFolder + skin + @"\pathbox_l.png");
                pathbox_m = Image.FromFile(SkinFolder + skin + @"\pathbox_m.png");
                pathbox_m_s = Image.FromFile(SkinFolder + skin + @"\pathbox_m_s.png");
                pathbox_refresh = Image.FromFile(SkinFolder + skin + @"\pathbox_refresh.png");
                pathbox_refresh_s = Image.FromFile(SkinFolder + skin + @"\pathbox_refresh_s.png");
                pathbox_refresh_o = Image.FromFile(SkinFolder + skin + @"\pathbox_refresh_o.png");
                pathbox_refresh_c = Image.FromFile(SkinFolder + skin + @"\pathbox_refresh_c.png");
                pathbox_selection_l_o = Image.FromFile(SkinFolder + skin + @"\pathbox_selection_l_o.png");
                pathbox_selection_l_c = Image.FromFile(SkinFolder + skin + @"\pathbox_selection_l_c.png");
                pathbox_selection_m_o = Image.FromFile(SkinFolder + skin + @"\pathbox_selection_m_o.png");
                pathbox_selection_m_c = Image.FromFile(SkinFolder + skin + @"\pathbox_selection_m_c.png");
                pathbox_selection_r_o = Image.FromFile(SkinFolder + skin + @"\pathbox_selection_r_o.png");
                pathbox_selection_r_c = Image.FromFile(SkinFolder + skin + @"\pathbox_selection_r_c.png");
                pathbox_separator_arrow = Image.FromFile(SkinFolder + skin + @"\pathbox_separator_arrow.png");

                //---------- Explorer

                explorer_tile_selection_t_o = Image.FromFile(SkinFolder + skin + @"\explorer_tile_selection_t_o.png");
                explorer_tile_selection_t_c = Image.FromFile(SkinFolder + skin + @"\explorer_tile_selection_t_c.png");
                explorer_tile_selection_t_oc = Image.FromFile(SkinFolder + skin + @"\explorer_tile_selection_t_oc.png");
                explorer_tile_selection_m_o = Image.FromFile(SkinFolder + skin + @"\explorer_tile_selection_m_o.png");
                explorer_tile_selection_m_c = Image.FromFile(SkinFolder + skin + @"\explorer_tile_selection_m_c.png");
                explorer_tile_selection_m_oc = Image.FromFile(SkinFolder + skin + @"\explorer_tile_selection_m_oc.png");
                explorer_tile_selection_b_o = Image.FromFile(SkinFolder + skin + @"\explorer_tile_selection_b_o.png");
                explorer_tile_selection_b_c = Image.FromFile(SkinFolder + skin + @"\explorer_tile_selection_b_c.png");
                explorer_tile_selection_b_oc = Image.FromFile(SkinFolder + skin + @"\explorer_tile_selection_b_oc.png");

                explorer_detail_selection_l_o = Image.FromFile(SkinFolder + skin + @"\explorer_detail_selection_l_o.png");
                explorer_detail_selection_l_c = Image.FromFile(SkinFolder + skin + @"\explorer_detail_selection_l_c.png");
                explorer_detail_selection_l_oc = Image.FromFile(SkinFolder + skin + @"\explorer_detail_selection_l_oc.png");
                explorer_detail_selection_m_o = Image.FromFile(SkinFolder + skin + @"\explorer_detail_selection_m_o.png");
                explorer_detail_selection_m_c = Image.FromFile(SkinFolder + skin + @"\explorer_detail_selection_m_c.png");
                explorer_detail_selection_m_oc = Image.FromFile(SkinFolder + skin + @"\explorer_detail_selection_m_oc.png");
                explorer_detail_selection_r_o = Image.FromFile(SkinFolder + skin + @"\explorer_detail_selection_r_o.png");
                explorer_detail_selection_r_c = Image.FromFile(SkinFolder + skin + @"\explorer_detail_selection_r_c.png");
                explorer_detail_selection_r_oc = Image.FromFile(SkinFolder + skin + @"\explorer_detail_selection_r_oc.png");

                explorer_header_arrow_up = Image.FromFile(SkinFolder + skin + @"\explorer_header_arrow_up.png");
                explorer_header_arrow_down = Image.FromFile(SkinFolder + skin + @"\explorer_header_arrow_down.png");

                explorer_header_l = Image.FromFile(SkinFolder + skin + @"\explorer_header_l.png");
                explorer_header_l_o = Image.FromFile(SkinFolder + skin + @"\explorer_header_l_o.png");
                explorer_header_l_c = Image.FromFile(SkinFolder + skin + @"\explorer_header_l_c.png");
                explorer_header_m = Image.FromFile(SkinFolder + skin + @"\explorer_header_m.png");
                explorer_header_m_o = Image.FromFile(SkinFolder + skin + @"\explorer_header_m_o.png");
                explorer_header_m_c = Image.FromFile(SkinFolder + skin + @"\explorer_header_m_c.png");
                explorer_header_r = Image.FromFile(SkinFolder + skin + @"\explorer_header_r.png");
                explorer_header_r_o = Image.FromFile(SkinFolder + skin + @"\explorer_header_r_o.png");
                explorer_header_r_c = Image.FromFile(SkinFolder + skin + @"\explorer_header_r_c.png");

                //---------- Quick Links

                quicklink_l_o = Image.FromFile(SkinFolder + skin + @"\quicklink_l_o.png");
                quicklink_l_c = Image.FromFile(SkinFolder + skin + @"\quicklink_l_c.png");
                quicklink_l_oc = Image.FromFile(SkinFolder + skin + @"\quicklink_l_oc.png");
                quicklink_m_o = Image.FromFile(SkinFolder + skin + @"\quicklink_m_o.png");
                quicklink_m_c = Image.FromFile(SkinFolder + skin + @"\quicklink_m_c.png");
                quicklink_m_oc = Image.FromFile(SkinFolder + skin + @"\quicklink_m_oc.png");
                quicklink_r_o = Image.FromFile(SkinFolder + skin + @"\quicklink_r_o.png");
                quicklink_r_c = Image.FromFile(SkinFolder + skin + @"\quicklink_r_c.png");
                quicklink_r_oc = Image.FromFile(SkinFolder + skin + @"\quicklink_r_oc.png");

                //---------- Guia Horizontal

                tab_horizontal_l = Image.FromFile(SkinFolder + skin + @"\tab_horizontal_l.png");
                tab_horizontal_l_o = Image.FromFile(SkinFolder + skin + @"\tab_horizontal_l_o.png");
                tab_horizontal_l_c = Image.FromFile(SkinFolder + skin + @"\tab_horizontal_l_c.png");
                tab_horizontal_m = Image.FromFile(SkinFolder + skin + @"\tab_horizontal_m.png");
                tab_horizontal_m_o = Image.FromFile(SkinFolder + skin + @"\tab_horizontal_m_o.png");
                tab_horizontal_m_c = Image.FromFile(SkinFolder + skin + @"\tab_horizontal_m_c.png");
                tab_horizontal_r = Image.FromFile(SkinFolder + skin + @"\tab_horizontal_r.png");
                tab_horizontal_r_o = Image.FromFile(SkinFolder + skin + @"\tab_horizontal_r_o.png");
                tab_horizontal_r_c = Image.FromFile(SkinFolder + skin + @"\tab_horizontal_r_c.png");

                //------------------------ Barras de progresso

                progressbar_blue = Image.FromFile(SkinFolder + skin + @"\progressbar_blue.png");
                progressbar_green = Image.FromFile(SkinFolder + skin + @"\progressbar_green.png");
                progressbar_red = Image.FromFile(SkinFolder + skin + @"\progressbar_red.png");
                progressbar_gray = Image.FromFile(SkinFolder + skin + @"\progressbar_gray.png");

                progresscontainer_l = Image.FromFile(SkinFolder + skin + @"\progresscontainer_l.png");
                progresscontainer_m = Image.FromFile(SkinFolder + skin + @"\progresscontainer_m.png");
                progresscontainer_r = Image.FromFile(SkinFolder + skin + @"\progresscontainer_r.png");

                //------------------------ Ícones

                //---------- analisador de FS

                drivemapblock_blue = Image.FromFile(SkinFolder + skin + @"\drivemapblock_blue.png");
                drivemapblock_red = Image.FromFile(SkinFolder + skin + @"\drivemapblock_red.png");
                drivemapblock_green = Image.FromFile(SkinFolder + skin + @"\drivemapblock_green.png");
                drivemapblock_yellow = Image.FromFile(SkinFolder + skin + @"\drivemapblock_yellow.png");
                drivemapblock_gray = Image.FromFile(SkinFolder + skin + @"\drivemapblock_gray.png");

                //---------- quick links

                icon_16x16_desktop = Image.FromFile(SkinFolder + skin + @"\icon_16x16_desktop.png");
                icon_16x16_documents = Image.FromFile(SkinFolder + skin + @"\icon_16x16_documents.png");
                icon_16x16_folder = Image.FromFile(SkinFolder + skin + @"\icon_16x16_folder.png");
                icon_16x16_file = Image.FromFile(SkinFolder + skin + @"\icon_16x16_file.png");
                icon_16x16_zip = Image.FromFile(SkinFolder + skin + @"\icon_16x16_zip.png");
                icon_16x16_iso = Image.FromFile(SkinFolder + skin + @"\icon_16x16_iso.png");
                icon_16x16_disc = Image.FromFile(SkinFolder + skin + @"\icon_16x16_disc.png");
                icon_16x16_covers = Image.FromFile(SkinFolder + skin + @"\icon_16x16_covers.png");
                icon_16x16_favorites = Image.FromFile(SkinFolder + skin + @"\icon_16x16_favorites.png");
                icon_16x16_library = Image.FromFile(SkinFolder + skin + @"\icon_16x16_libraries.png");
                icon_16x16_computer = Image.FromFile(SkinFolder + skin + @"\icon_16x16_computer.png");

                icon_16x16_harddrive = Image.FromFile(SkinFolder + skin + @"\icon_16x16_harddrive.png");
                icon_16x16_usbdrive = Image.FromFile(SkinFolder + skin + @"\icon_16x16_usbdrive.png");
                icon_16x16_windrive = Image.FromFile(SkinFolder + skin + @"\icon_16x16_windrive.png");
                icon_16x16_cddrive = Image.FromFile(SkinFolder + skin + @"\icon_16x16_cddrive.png");
                icon_16x16_cddrive_full = Image.FromFile(SkinFolder + skin + @"\icon_16x16_cddrive_full.png");
                icon_16x16_wbfsdrive = Image.FromFile(SkinFolder + skin + @"\icon_16x16_wbfsdrive.png");
                icon_16x16_floppydrive = Image.FromFile(SkinFolder + skin + @"\icon_16x16_floppydrive.png");

                icon_48x48_harddrive = Image.FromFile(SkinFolder + skin + @"\icon_48x48_harddrive.png");
                icon_48x48_usbdrive = Image.FromFile(SkinFolder + skin + @"\icon_48x48_usbdrive.png");
                icon_48x48_windrive = Image.FromFile(SkinFolder + skin + @"\icon_48x48_windrive.png");
                icon_48x48_cddrive = Image.FromFile(SkinFolder + skin + @"\icon_48x48_cddrive.png");
                icon_48x48_cddrive_full = Image.FromFile(SkinFolder + skin + @"\icon_48x48_cddrive_full.png");
                icon_48x48_wbfsdrive = Image.FromFile(SkinFolder + skin + @"\icon_48x48_wbfsdrive.png");
                icon_48x48_floppydrive = Image.FromFile(SkinFolder + skin + @"\icon_48x48_floppydrive.png");
                icon_48x48_bigfloppydrive = Image.FromFile(SkinFolder + skin + @"\icon_48x48_bigfloppydrive.png");

                icon_48x48_wiidisc = Image.FromFile(SkinFolder + skin + @"\icon_48x48_wiidisc.png");
                icon_48x48_wiidisc_jap = Image.FromFile(SkinFolder + skin + @"\icon_48x48_wiidisc_jap.png");
                icon_48x48_wiidisc_usa = Image.FromFile(SkinFolder + skin + @"\icon_48x48_wiidisc_usa.png");
                icon_48x48_wiidisc_eur = Image.FromFile(SkinFolder + skin + @"\icon_48x48_wiidisc_eur.png");
                icon_48x48_wiidisc_unk = Image.FromFile(SkinFolder + skin + @"\icon_48x48_wiidisc_unk.png");

                icon_48x48_folder = Image.FromFile(SkinFolder + skin + @"\icon_48x48_folder.png");
                icon_48x48_file = Image.FromFile(SkinFolder + skin + @"\icon_48x48_file.png");
                icon_48x48_zip = Image.FromFile(SkinFolder + skin + @"\icon_48x48_zip.png");
                icon_48x48_iso = Image.FromFile(SkinFolder + skin + @"\icon_48x48_iso.png");

                icon_72x72_folder = Image.FromFile(SkinFolder + skin + @"\icon_72x72_folder.png");
                icon_72x72_file = Image.FromFile(SkinFolder + skin + @"\icon_72x72_file.png");
                icon_72x72_zip = Image.FromFile(SkinFolder + skin + @"\icon_72x72_zip.png");
                icon_72x72_iso = Image.FromFile(SkinFolder + skin + @"\icon_72x72_iso.png");

                //---------- operações

                icon_11x11_export_covers = Image.FromFile(SkinFolder + skin + @"\icon_11x11_export_covers.png");
                icon_11x11_export_covers_o = Image.FromFile(SkinFolder + skin + @"\icon_11x11_export_covers_o.png");

                icon_11x11_add = Image.FromFile(SkinFolder + skin + @"\icon_11x11_add.png");
                icon_11x11_add_o = Image.FromFile(SkinFolder + skin + @"\icon_11x11_add_o.png");

                icon_11x11_remove = Image.FromFile(SkinFolder + skin + @"\icon_11x11_remove.png");
                icon_11x11_remove_o = Image.FromFile(SkinFolder + skin + @"\icon_11x11_remove_o.png");

                icon_11x11_ripdvd = Image.FromFile(SkinFolder + skin + @"\icon_11x11_ripdvd.png");
                icon_11x11_ripdvd_o = Image.FromFile(SkinFolder + skin + @"\icon_11x11_ripdvd_o.png");

                icon_16x16_cut = Image.FromFile(SkinFolder + skin + @"\icon_16x16_cut.png");
                icon_16x16_copy = Image.FromFile(SkinFolder + skin + @"\icon_16x16_copy.png");
                icon_16x16_paste = Image.FromFile(SkinFolder + skin + @"\icon_16x16_paste.png");
                icon_16x16_delete = Image.FromFile(SkinFolder + skin + @"\icon_16x16_delete.png");

                //---------- log

                icon_16x16_log_error = Image.FromFile(SkinFolder + skin + @"\icon_16x16_log_error.png");
                icon_16x16_log_warning = Image.FromFile(SkinFolder + skin + @"\icon_16x16_log_warning.png");
                icon_16x16_log_message = Image.FromFile(SkinFolder + skin + @"\icon_16x16_log_message.png");

                //---------- guias

                icon_16x16_log = Image.FromFile(SkinFolder + skin + @"\icon_16x16_log.png");
                icon_16x16_clipboard = Image.FromFile(SkinFolder + skin + @"\icon_16x16_clipboard.png");
                icon_16x16_operations = Image.FromFile(SkinFolder + skin + @"\icon_16x16_operations.png");
                
                //---------- menu

                icon_16x16_config = Image.FromFile(SkinFolder + skin + @"\icon_16x16_config.png");
                icon_16x16_donate = Image.FromFile(SkinFolder + skin + @"\icon_16x16_donate.png");
                icon_16x16_help = Image.FromFile(SkinFolder + skin + @"\icon_16x16_help.png");

                //---------- modo de visualização

                icon_16x16_view_cover = Image.FromFile(SkinFolder + skin + @"\icon_16x16_view_cover.png");
                icon_16x16_view_tile = Image.FromFile(SkinFolder + skin + @"\icon_16x16_view_tile.png");
                icon_16x16_view_details = Image.FromFile(SkinFolder + skin + @"\icon_16x16_view_details.png");
                icon_16x16_view_list = Image.FromFile(SkinFolder + skin + @"\icon_16x16_view_list.png");

                //---------- capas

                cover_nocover = Image.FromFile(SkinFolder + skin + @"\cover_nocover.png");
                cover_nocover_big = Image.FromFile(SkinFolder + skin + @"\cover_nocover_big.png");

                cover_shadow_big = Image.FromFile(SkinFolder + skin + @"\cover_shadow_big.png");
                cover_shadow = Image.FromFile(SkinFolder + skin + @"\cover_shadow.png");
            }
            catch(Exception e)
            {
                Log.LogException(e);
                return false;
            }

            SkinReady = true;
            return true;
        }

        public static void LoadFonts()
        {
            //Carrega as fontes
            CaptionFont = new Font("Segoe UI", 9.0f, FontStyle.Regular, GraphicsUnit.Point);
            DefaultFont = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Regular, GraphicsUnit.Point);
            DialogFont = new Font("Tahoma", 8.0f, FontStyle.Regular, GraphicsUnit.Point);
            IconTitleFont = new Font("Segoe UI", 9.0f, FontStyle.Regular, GraphicsUnit.Point);
            MenuFont = new Font("Segoe UI", 9.0f, FontStyle.Regular, GraphicsUnit.Point);
            MessageBoxFont = new Font("Segoe UI", 9.0f, FontStyle.Regular, GraphicsUnit.Point);
            SmallCaptionFont = new Font("Segoe UI", 9.0f, FontStyle.Regular, GraphicsUnit.Point);
            StatusFont = new Font("Segoe UI", 9.0f, FontStyle.Regular, GraphicsUnit.Point);

            //Verifica se alguma não foi carregada, tenta carregar a padrão
            if (CaptionFont == null) CaptionFont = new Font(SystemFonts.CaptionFont, FontStyle.Regular);
            if (DefaultFont == null) DefaultFont = new Font(SystemFonts.DefaultFont, FontStyle.Regular);
            if (DialogFont == null) DialogFont = new Font(SystemFonts.DialogFont, FontStyle.Regular);
            if (IconTitleFont == null) IconTitleFont = new Font(SystemFonts.IconTitleFont, FontStyle.Regular);
            if (MenuFont == null) MenuFont = new Font(SystemFonts.MenuFont, FontStyle.Regular);
            if (MessageBoxFont == null) MessageBoxFont = new Font(SystemFonts.MessageBoxFont, FontStyle.Regular);
            if (SmallCaptionFont == null) SmallCaptionFont = new Font(SystemFonts.SmallCaptionFont, FontStyle.Regular);
            if (StatusFont == null) StatusFont = new Font(SystemFonts.StatusFont, FontStyle.Regular);
        }

        public static int Dispose(String configfile)
        {
            //Descarrega as fontes
            if (CaptionFont != null) CaptionFont.Dispose();
            if (DefaultFont != null) DefaultFont.Dispose();
            if (DialogFont != null) DialogFont.Dispose();
            if (IconTitleFont != null) IconTitleFont.Dispose();
            if (MenuFont != null) MenuFont.Dispose();
            if (MessageBoxFont != null) MessageBoxFont.Dispose();
            if (SmallCaptionFont != null) SmallCaptionFont.Dispose();
            if (StatusFont != null) StatusFont.Dispose();

            return 0;
        }
    }
}
